package com.jingdun.sport.api.security;

import com.jingdun.sport.security.provider.AuthenticationTokenParser;
import com.jingdun.sport.common.util.Json;
import org.springframework.security.authentication.AbstractAuthenticationToken;
import org.springframework.stereotype.Component;

@Component
public class AppAuthenticationTokenParser implements AuthenticationTokenParser {

    @Override
    public AbstractAuthenticationToken parse(String authenticationTokenStr) {
        AppAuthenticationToken authRequest = Json.parseObject(authenticationTokenStr, AppAuthenticationToken.class);
        return authRequest;
    }
}